package fundamentals;

public class ForEach {

	public static void main(String[] args) {
		Object myObj = new String[]{"one", "two", "three"};
		method((String[]) myObj);
		method1(new String[]{"one", "two", "three"});
		method("one","two","three");
//		for (String s : (String[])myObj)
//			System.out.print(s + ".");
	}
	
	
	private static void method(String... strings) {
		System.out.print("String... = " );
		for (String string : strings) {
			System.out.print(string + " ");
		}
		System.out.println();
	}
	
	private static void method1(String[] strings) {
		System.out.print("String[] = " );
		for (String string : strings) {
			System.out.print(string + " ");
		}
		System.out.println();
	}
}
